﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using System.Data;

namespace EntryExit
{
    public partial class AttendanceReports : DevExpress.XtraReports.UI.XtraReport
    {
        public AttendanceReports(string reportSubject, DataTable data)
        {
            InitializeComponent();
            ClearDataContext();

            lblRptHead.Text = reportSubject;
            if (data != null)
            {
                BindLabels(data);
            }
        }

        private void BindLabels(DataTable data)
        {
            data.DefaultView.Sort = "AuthorityName, Name";

            this.DataSource = data;

            XRBinding bindingSlNo = new XRBinding("Text", data, "SlNo");
            XRBinding bindingLPN = new XRBinding("Text", data, "LPN");
            XRBinding bindingName = new XRBinding("Text", data, "Name");
            XRBinding bindingDate = new XRBinding("Text", data, "Date");

            lblDataSlNo.DataBindings.Add(bindingSlNo);
            lblDataLpn.DataBindings.Add(bindingLPN);
            lblDataName.DataBindings.Add(bindingName);
            lblDataDate.DataBindings.Add(bindingDate);
            
        }

    }
}
